<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:body>
	<ui:composition template="templates/commonPage.xhtml">
		<ui:define name="pagecontent">
			<h1>Create an account</h1>
			<hr/>
			<div class="createAccount">
			<h:form id="Form">
				<fieldset>
				
					<h2>Personnal Informations</h2>			
					<hr/>
					<h:outputLabel for="firstName">First Name<span class="requis">*</span></h:outputLabel>
					<h:inputText id="firstName" value="#{createAccountMB.user.firstName}" required="true" size="20" maxlength="60"/>
					<br />
								
					<h:outputLabel for="lastName">Last Name<span class="requis">*</span></h:outputLabel>
					<h:inputText id="lastName" value="#{createAccountMB.user.lastName}" required="true" size="20" maxlength="60"/>
					<br />
					
					<h:outputLabel >Date of birth<span class="requis">*</span></h:outputLabel>
					<span>Day :  </span>
					<h:inputText type="text" id="birthDateDay" value="#{createAccountMB.clientDateOfBirthDay}" 
						styleClass="birthDateDayMonth" maxlength="2"/>
					<span>Month : </span>
					<h:inputText type="text" id="birthDateMonth" value="#{createAccountMB.clientDateOfBirthMonth}" 
						styleClass="birthDateDayMonth" maxlength="2"/>
					<span>Year :  </span>
					<h:inputText type="text" id="birthDateYear" value="#{createAccountMB.clientDateOfBirthYear}" 
						styleClass="birthDateYear" maxlength="4"/>

					
					<h2>Contact Informations</h2>
					<hr/>
					<h:outputLabel for="aStreetNumber">Street number<span class="requis">*</span></h:outputLabel>
					<h:inputText id="aStreetNumber" value="#{createAccountMB.user.address.streetNumber}" required="true" />


					
					<h:outputLabel for="aStreet">Street<span class="requis">*</span></h:outputLabel>
					<h:inputText id="aStreet" value="#{createAccountMB.user.address.street}" required="true" />
					<br />

					<h:outputLabel for="aTown">Town<span class="requis">*</span></h:outputLabel>
					<h:inputText id="aTown" value="#{createAccountMB.user.address.town}" required="true" />
					<br/>
					
					<h:outputLabel for="aZipCode">Zip Code<span>*</span></h:outputLabel>
					<h:inputText id="aZipCode" value="#{createAccountMB.user.address.zipCode}" required="true"/>

					<h:outputLabel for="aCountry">Country<span>*</span></h:outputLabel>
					<h:inputText id="aCountry" value="#{createAccountMB.user.address.country}" required="true"/>
 


					<h:outputLabel for="phoneNumber">Phone number<span class="requis">*</span></h:outputLabel>
					<h:inputText id="phoneNumber" value="#{createAccountMB.user.phoneNumber}" 
						required="true" size="20" maxlength="20">
							<!-- 	<f:converter converterId="javax.faces.Number" /> -->
							<!-- 	!!!!! CHANGER LE FORMAT DE TELEPHONE SI POSSIBLE !!!!! -->
							<!-- 	!!!!! CHANGER LE FORMAT DE TELEPHONE SI POSSIBLE !!!!! -->
							<!-- 	!!!!! CHANGER LE FORMAT DE TELEPHONE SI POSSIBLE !!!!! -->
					</h:inputText>
					<br/>
						
					
					<h2>Login Informations</h2>
					<hr/>
					<h:outputLabel for="mail">Mail<span class="requis">*</span></h:outputLabel>
					<h:inputText id="mail" value="#{createAccountMB.user.mail}" required="true" size="20" maxlength="100"/>
					<br />
					
					<h:outputLabel for="password">Password<span class="requis">*</span></h:outputLabel>
					<h:inputSecret id="password" value="#{createAccountMB.user.password}" required="true" size="20" maxlength="20"/>
					<br />
					
					
					<h:commandButton action="#{createAccountMB.createUser}" value="Register"/>

				</fieldset>
			</h:form>
			</div>
			<br />
		</ui:define>

	</ui:composition>
</h:body>
</html>